<%
Response.Expires = 60
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
'HienSX
sort=Request("sort")
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<link rel=stylesheet href="..\CSS\styleform.css" type="text/css">
<title>TỜ TRÌNH</title>
<script language="javascript" src="..\JS\toolBarButton.js"></script>
<!--#include file="..\CheckSession.inc"-->
<!--#include file="..\jvFunction.inc"-->
<!--#include file=..\funTab.inc-->
</head>
<body style="font-family: Times New Roman" topmargin=0 leftmargin=0 bgcolor=#BDD5D0>
<form method="post" name="Noidung">
<!-- HienSX -->
<Input TYPE="hidden" name="Sort" value="<%=sort%>">
<Input name="TxtID" size="50" type="hidden">
<table cellspacing=0 cellpadding=0 border=0 style="table-layout: fixed; height: 1px">
	<tr><td style="width: 100%; height: 1px; background-color: white">&nbsp;</td></tr>
</table>
<table id=toolbar cellspacing="0" >
	<tr>
		<td>
			<table cellspacing="0">
				<tr>
					<td class="toolBarButton" id=btnSearch onaction="javascript:OK()"><img src="..\images\icons\button_search.gif" align="absmiddle" width="16" height="20"> <b>Tìm kiếm</b></td>
					<td class="toolBarButton" id=btnCancel onaction="javascript:window.close()"><img src="..\images\icons\button_cancel.gif" align="absmiddle" width="16" height="20"><b>Bỏ qua</b></td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<table cellspacing=0 cellpadding=0 border=0 style="table-layout: fixed; height: 1px">
	<tr><td style="width: 100%; height: 1px; background-color: 808080">&nbsp;</td></tr>
</table>
</table>
<table class="controlbox" width="100%">	
<tr> 
<td valign="top">
<FIELDSET> 
<LEGEND><b>Thông tin tìm kiếm :</b></LEGEND> 
<table width="100%" bgColor="#BDD5D0" border="0" cellpadding="0" cellSpacing="0" style="FONT-SIZE: 9pt;Font-family:Arial" >
      <tr>
        <td width="18%">&nbsp;Số đến</td>
        <td width="15%"><input name=TxtSoden style="font-family:times new roman;width:100%" size="20" LANGUAGE=javascript onkeyup="return TxtSoden_onkeyup(this.value)"></td>
		<td width="15%" align=center>===></td>
		<td width="15%"><input name=TxtDenso style="font-family:times new roman;width:100%" size="20"></td>
        <td width="15%" align=center>Năm</td>
		<td width="15%"><input name=TxtNam maxlength=4 style="font-family:Times New Roman;width:100%;" size="20" value=<%=year(Date())%> ></td>
		<td width="7%">&nbsp;</td>
      </tr>
      <tr>
        <td width="18%">&nbsp;Ngày đến</td>
        <td width="15%"><input name=TxtTungay disabled style="font-family:times new roman;width:100%;background-color:#C0C0C0" size="20"  maxlength=10 LANGUAGE=javascript onkeyup="return TxtTungay_onkeyup(this.value)"></td>
        <td width="15%" align=center>===></td> 
        <td width="15%"><input name=TxtDenngay disabled style="font-family:times new roman;width:100%;background-color:#C0C0C0" size="20" maxlength=10 LANGUAGE=javascript onkeyup="return TxtDenngay_onkeyup(this.value)"></td>
        <td width="15%" align=center>
        <INPUT TYPE="checkbox" NAME="CHK"  onclick="return Cmd(true)" value="ON"></td>        
        <td width="22%" colspan=2><label for=C1 >Tìm chính xác</label><INPUT TYPE="checkbox" NAME="chkTimCX" value="ON" id=C1></td>
      </tr>
	  <tr>
	   	<td width="18%"><input type=button name=CmdNoigui value="Nơi gửi" onclick="javaScript:openNoigui()" style="font-family:Arial;font-size: 8pt;width:100%; height:23px; background-color:#BDD5D0"></td> 
		<td width="82%" colspan="6"><input type=text name=TxtNoigui maxLength=500 style='font-family: Arial; width:100%' size="20"></td>
      </tr>
	  <tr>
        <td width="18%">&nbsp;Số ký hiệu</td>
		<td width="30%" colspan=2><input name=TxtSokyhieu style="font-family:Times New Roman;width:100%" size="20"></td>
        <td width="15%" align=center>Ngày ký</td>
		<td width="37%" colspan=3><input name=TxtNgayky style="font-family:Times New Roman;width:100%" LANGUAGE=javascript onkeyup="return TxtNgayky_onkeyup(this.value)" size="20"></td>
	  </tr>
      <tr>
      	<td width="18%">&nbsp;Người nhận</td>
		<td width="82%" colspan="6"><input type=text name=TxtNguoinhan maxLength=500 style='font-family:Times New Roman; width:100%' size="20"></td>  
      </tr>
      <tr>
        <td width="18%">&nbsp;Trích yếu</td>
        <td width="82%" colspan=6><input name=TxtTrichyeu style="font-family:Times New Roman;width:100%" size="20"></td>
	  </tr>
      <tr> 
        <td width="18%">&nbsp;Ý kiến chỉ đạo</td>
        <td width="82%" colspan=6><input name=TxtYkien style="font-family:Times New Roman;width:100%" size="20"></td>
	  </tr>
	  <tr>
	  </tr>
		<td width="18%">&nbsp;Đơn vị XL</td>
        <td width="30%" colspan=2>
			<Select name=cboDonviXL style="font-family:Times New Roman;width:100%">
        		<option value=""></option>
        		<%
        			sSQL="Select * from DonVi where madonvi like '00%00' and madonvi <> '000000' order by Madonvi"
				Set Rec=server.CreateObject("ADODB.Recordset")
				Rec.CursorType=3
				Rec.CacheSize=5
				Rec.Open sSQL,Conn
				Do While not Rec.EOF %>
					<option value=<%=trim(Rec("TenDonVi"))%>><% =funTab(Rec("MaDonvi"))%><%=Rec("TenDonVi")%></option>
				<%
					Rec.MoveNext
				Loop
				Rec.Close
				Set Rec=nothing
			%>	
        	</select>
	  </td>
	  <td width="15%" align="center">Hạn xử lý</td>
      <td width="37%" colspan=3><input name=TxtHanXL style="font-family:Times New Roman;width:100%" LANGUAGE=javascript onkeyup="return TxtHanXL_onkeyup(this.value)" size="20"></td>
      </tr>
      <tr>
        <td width="100%" colspan=7></td>
      </tr>
  </table>
</FIELDSET>
			</td>
		</tr>
	</table>
</form>
<script>
		var btn;	
		btn = document.getElementById("btnSearch"); createButton(btn);	btn.setEnabled(true);
		btn = document.getElementById("btnCancel"); createButton(btn);	btn.setEnabled(true);
</script>
</body>
<Script language=javascript>
	function openNoigui(sObj) {  
		popupWin = 		window.open('AddDV.asp?bType=TT','page_SearchTT','width=300,height=300').focus(); 
	}

	function KT(){
		if(trim(Noidung.TxtTungay.value)!="" && Noidung.TxtTungay.disabled==false){
			if(!isDate(Noidung.TxtTungay.value)){
				alert("Ngày không hợp lệ !");
				Noidung.TxtTungay.focus();
				return false;
			}
		}
		if(trim(Noidung.TxtDenngay.value)!="" && Noidung.TxtDenngay.disabled==false){
			if(!isDate(Noidung.TxtDenngay.value)){
				alert("Ngày không hợp lệ !");
				Noidung.TxtDenngay.focus();
				return false;
			}
		}

		if(trim(Noidung.TxtNam.value)!="" && Noidung.TxtNam.disabled==false){
			if(!IsNumeric(Noidung.TxtNam.value)){
				alert("Năm không hợp lệ !");
				Noidung.TxtNam.focus();
				return false;
			}
		}
		return true;
	}
	function OK(){
		if(KT()){
			Noidung.target="right";
			if(Noidung.CHK.checked){
				Noidung.action="frmdsTotrinh.asp?bComm=search&VT=Totrinh&bLoai=1&sort="+Noidung.Sort.value;
			}
			else{
				Noidung.action="frmdsTotrinh.asp?bComm=search&VT=Totrinh&bLoai=0&sort="+Noidung.Sort.value;
			}
			Noidung.submit();
			window.close();
		}
	}

	function Cmd(){
		if (Noidung.CHK.checked){
			Noidung.TxtNam.disabled=true;
			Noidung.TxtTungay.disabled=false;
			Noidung.TxtDenngay.disabled=false;
			Noidung.TxtNam.style.background="#C0C0C0";
			Noidung.TxtTungay.style.background="#FFFFFF";
			Noidung.TxtDenngay.style.background="#FFFFFF";
			Noidung.TxtTungay.focus();		
		}
		else{
			Noidung.TxtSoden.disabled=false;
			Noidung.TxtDenso.disabled=false;
			Noidung.TxtNam.disabled=false;
			Noidung.TxtTungay.disabled=true;
			Noidung.TxtDenngay.disabled=true;
			Noidung.TxtNam.value="<%=year(Date())%>";
			Noidung.TxtNam.style.background="#FFFFFF";
			Noidung.TxtTungay.style.background="#C0C0C0";
			Noidung.TxtDenngay.style.background="#C0C0C0";
			Noidung.TxtSoden.focus();		
		}
		
}

function TxtTungay_onkeyup(str){
	var keycode
	keycode=window.event.keyCode
	if (isEdit(keycode,str)){
		Noidung.TxtTungay.value=editdate(trim(str))
	}
	Noidung.TxtDenngay.value=Noidung.TxtTungay.value
}

function TxtDenngay_onkeyup(str){
	var keycode
	keycode=window.event.keyCode
	if (isEdit(keycode,str)){
		Noidung.TxtDenngay.value=editdate(trim(str))
	}
}
function TxtNgayky_onkeyup(str){
	var keycode
	keycode=window.event.keyCode
	if (isEdit(keycode,str)){
		Noidung.TxtNgayky.value=editdate(trim(str))
	}
}

function TxtHanXL_onkeyup(str){
	var keycode
	keycode=window.event.keyCode
	if (isEdit(keycode,str)){
		Noidung.TxtHanXL.value=editdate(trim(str))
	}
}

function TxtSoden_onkeyup(str){
	Noidung.TxtDenso.value=Noidung.TxtSoden.value
}
</script>
</html>